package particlesystem.core {
	import particlesystem.utils.Range;

	import flash.display.Sprite;
	import flash.geom.Rectangle;

	/**
	 * @author robertthurston
	 */
	public class ParticleSettings {

		private var _startX : Range;
		private var _startY : Range;
		private var _startDelayRange : Range;
		private var _emitter : Sprite;
		private var _reSpawn : Boolean;
		private var _bitmapAnimationParticles : Array;

		public function set startBounds(startBounds : Rectangle) : void {
			_startX = new Range(startBounds.x, startBounds.x + startBounds.width);
			_startY = new Range(startBounds.y, startBounds.y + startBounds.height);
		}

		public function get startX() : Number {
			return _startX.range + emitter.x;
		}

		public function get startY() : Number {
			return _startY.range + emitter.y;
		}

		public function get emitter() : Sprite {
			return _emitter;
		}

		public function set emitter(emitter : Sprite) : void {
			_emitter = emitter;
		}

		public function get reSpawn() : Boolean {
			return _reSpawn;
		}

		public function set reSpawn(reSpawn : Boolean) : void {
			_reSpawn = reSpawn;
		}

		public function get bitmapAnimationParticles() : Array {
			return _bitmapAnimationParticles;
		}

		public function set bitmapAnimationParticles(bitmapAnimationParticles : Array) : void {
			_bitmapAnimationParticles = bitmapAnimationParticles;
		}

		public function get startDelay() : Number {
			return _startDelayRange.range;
		}

		public function set startDelayRange(startDelayRange : Range) : void {
			_startDelayRange = startDelayRange;
		}

		public function getRandomBitmapAnimationParticle() : Array {
			return _bitmapAnimationParticles[Math.floor(Math.random() * _bitmapAnimationParticles.length)];
		}
	}
}
